# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Maintainer: Andreas Radke <andyrtr@archlinux.org>

pkgname='mesa-demos'
pkgver=8.3.0
pkgrel=4
arch=('i686' 'x86_64')
pkgdesc="Mesa demos and tools incl. glxinfo + glxgears"
url="http://mesa3d.sourceforge.net"
license=('custom')
depends=('libgl' 'glew' 'freeglut')
makedepends=('mesa' 'freetype2' 'git')
source=(ftp://ftp.freedesktop.org/pub/mesa/demos/$pkgver/mesa-demos-$pkgver.tar.bz2
        'LICENSE')
sha256sums=('c173154bbd0d5fb53d732471984def42fb1b14ac85fcb834138fb9518b3e0bef'
            '7fdc119cf53c8ca65396ea73f6d10af641ba41ea1dd2bd44a824726e01c8b3f2')

build() {
  cd mesa-demos-$pkgver
  ./configure --prefix=/usr \
    --with-system-data-files=/usr/share/mesa-demos
  make
}

package() {
  cd mesa-demos-$pkgver
  make DESTDIR="${pkgdir}" install
  
  # add missing egl files
  install -m 0755 src/egl/opengl/{eglgears_x11,eglinfo,eglkms,egltri_x11,peglgears,xeglgears,xeglthreads} ${pkgdir}/usr/bin
  
  install -m755 -d "${pkgdir}/usr/share/licenses/mesa-demos"
  install -m755 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/mesa-demos/"
}
